<template>
  <div>
    <el-form
      ref="form"
      label-width="80px"
      :inline="false"
      size="normal"
      :model="formdata"
    >
      <el-row :gutter="10">
        <el-col :span="6" :offset="0">
          <el-form-item label="回复内容"> </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="20" :offset="1">
          <el-input
            v-model="feedbackcontent"
            type="textarea"
            placeholder="请回复.."
            size="normal"
            clearable
          ></el-input>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="20" :offset="0" style="margin-top: 30px">
          <el-popconfirm
          
            confirm-button-text="好的"
            cancel-button-text="不用了"
            icon="el-icon-info"
            icon-color="red"
            title="是否完成回复？"
            @onConfirm="handleConfirm"
          @onCancel="handleCancel"
            ><el-button type="primary"  slot="reference"
              >回复</el-button
            >
          </el-popconfirm>

          <el-button @click="gobackpage">取消</el-button>
        </el-col>
      </el-row>

      <!-- 保存和取消按钮 -->
    </el-form>
  </div>
</template>
<script>
export default {
  props: {
    backid: {
      type: Number,
      default: 0,
    },
  },
  data() {
    return {
      feedbackcontent: "",
      formdata: {
        backid: "",
        feedbackcontent: "",
      },
    };
  },
  methods: {
    gobackpage() {
      this.feedbackcontent = "";
      this.$emit("gobackscene", 1);
    },
    async gobackmeg() {
      //发起请求:
      this.formdata.backid = this.backid;
      this.formdata.feedbackcontent = this.feedbackcontent;
      let result = await this.$API.feedbackall.editfeedbackall(this.formdata);
      if (result.code === 200) {
        this.$message({
          type: "success",
          message: "回复成功",
        });
      }
      this.gobackpage();
    },
    handleConfirm() {
      // 处理确认操作的回调函数
      this.gobackmeg()
      // 在这里添加确认操作的代码
    },
    handleCancel() {
      // 处理取消操作的回调函数
      this.$message({
        message:"已取消操作",
        type:"warning"
      })
      // 在这里添加取消操作的代码
    },
  },
  computed: {},
  mounted() {},
};
</script>

<style>
.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}
</style>
